package com.wangshouyu.mp.base.request;

import com.google.common.io.ByteStreams;

import java.io.*;
import java.nio.ByteBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;


public interface ResponseBody extends Closeable {

    /**
     * 长度
     * @return
     */
    Integer length();

    /**
     * 是否重复
     * @return
     */
    boolean repeatable();

    /**
     * 输入流
     * @return
     * @throws IOException
     */
    InputStream inputStream() throws IOException;

    /**
     * 读取
     * @param charset 编码
     * @return
     * @throws IOException
     */
    Reader reader(Charset charset) throws IOException;

    Charset UTF_8 = Charset.forName("UTF-8");
}
